package com.senven.books.modules.booksManager.entity.form;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.senven.books.modules.booksManager.entity.Book;
import com.senven.books.mybatis.baseEntity.BaseForm;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;

@Data
@ApiModel(description = "图书form")
public class BookForm extends BaseForm<Book> {

    @ApiModelProperty(value = "id")
    @NotBlank(message = "id")
    private Long id;

    @ApiModelProperty(value = "书名")
    @NotBlank(message = "书名不能为空")
    private String title;

    @ApiModelProperty(value = "作者")
    @NotBlank(message = "作者不能为空")
    private String author;

    @ApiModelProperty(value = "类别")
    @NotBlank(message = "类别不能为空")
    private String category;

    @ApiModelProperty(value = "上架日期")
    @NotBlank(message = "上架日期不能为空")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date publishedDate;

    @ApiModelProperty(value = "出版社")
    @NotBlank(message = "出版社不能为空")
    private String press;

    @ApiModelProperty(value = "价格")
    @NotBlank(message = "价格不能为空")
    private double price;


}
